package com.dlc.shop.systemtest.api.order;

import com.dlc.shop.bean.app.dto.OrderSelfStationDto;
import com.dlc.shop.bean.app.dto.OrderShopDto;
import com.dlc.shop.bean.app.param.ProdCommParam;
import com.dlc.shop.common.response.ServerResponseEntity;
import com.dlc.shop.systemtest.constants.Constant;
import com.dlc.shop.systemtest.util.HttpUtil;
/**
 * @author Tu
 */

public class MyOrderApi {
    public static void receipt(String orderNumber){
        String uri = Constant.API_URL+"/p/myOrder/receipt/"+orderNumber;
        HttpUtil.put(uri,orderNumber);
    }

    /**
     * 查询订单项信息
     */
    public static OrderShopDto orderDetail(String orderNumber){
        String uri = Constant.API_URL+"/p/myOrder/orderDetail?orderNumber="+orderNumber;
        return HttpUtil.get(uri,OrderShopDto.class);
    }

    /**
     *订单取消
     */
    public static ServerResponseEntity<String> cancel(String orderNumber){
        String url = Constant.API_URL+"/p/myOrder/cancel/"+orderNumber;
        HttpUtil.put(url);
        return ServerResponseEntity.success();
    }

    /**
     *订单删除
     */
    public static ServerResponseEntity<String> delete(String orderNumber){
        String url = Constant.API_URL+"/p/myOrder/"+orderNumber;
        HttpUtil.delete(url);
        return ServerResponseEntity.success();
    }
    /**
     *查询自提订单提货码
     */
    public static OrderSelfStationDto getPickUpCode(String orderNumber){
        String url = Constant.API_URL+"/p/myStationOrder/stationDetail?orderNumber="+orderNumber;
        return HttpUtil.get(url,OrderSelfStationDto.class);
    }
    /**
     * 添加评价
     * */
    public static void addProdComm(ProdCommParam prodCommParam){
        String url = Constant.API_URL+"/p/prodComm";
        HttpUtil.post(url,prodCommParam);
    }
}
